package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

@Getter
public enum HobbyTypeEnum {
    JS_HOBBY(0, "健身"),
    KS_HOBBY(1, "看书"),
    LY_HOBBY(2, "旅游"),
    DY_HOBBY(3, "电影"),
    YX_HOBBY(4, "游戏"),
    MS_HOBBY(5, "美食"),
    YY_HOBBY(6, "音乐"),
    LZ_HOBBY(7, "绿植");

    private int code;

    private String desc;

    HobbyTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static HobbyTypeEnum getDscByType(Integer type) {
        for (HobbyTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
